<!--
	作者：956911785@qq.com
	时间：2019年11月21日17:04:33
	描述：账号管理
-->

<template>
	<div style="width:100%;">
		<div style="background: #fff;">
			<div style="width:100%;float:left;padding-top: 10px;padding-bottom: 10px;">
				<div style="width:5%;text-align: right;float:left;line-height:32px;">姓名：</div>
				<div style="width:15%;float:left;">
					<Input v-model.trim="tj.name"  clearable  style="width: 90%;float:left;" />
				</div>
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">账号：</div>
				<div style="width:15%;float:left;">
					<Input v-model.trim="tj.dlzh"  clearable  style="width: 90%;float:left;" />
				</div>
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">年级：</div>
				<div style="width:15%;float:left;">
					<Input v-model.trim="tj.nj"  clearable  style="width: 90%;float:left;" />
				</div>
				
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">班级：</div>
				<div style="width:15%;float:left;">
					<Input v-model.trim="tj.bj"  clearable  style="width: 90%;float:left;" />
				</div>
				
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">角色：</div>
				<div style="width:15%;float:left;">
					 <Select v-model.trim="tj.wstate" style="width:45%;float:left;" clearable>
						<Option value="">请选择</Option>
					    <Option value="1">学生</Option>
						<Option value="2">教师</Option>
					</Select>
				</div>
				
		
				<div style="width:80%;text-align: left;float:left;padding-left:2%;padding-top:10px;">
					<Button v-on:click="add()" icon="md-add" style="margin-left:1%;background: #2db7f5;color:#fff;border:1px solid #2db7f5;">新增</Button>
					<Button v-on:click="search()" style="margin-left:1%;background: #ffa500;color:#fff;border:1px solid #ffa500;">搜索</Button>
					<!-- <Button v-on:click="refresh()" style="margin-left:1%;background: #3fc1c9;color:#fff;border:1px solid #3fc1c9;">刷新</Button> -->
					<Button v-on:click="importU()" icon="md-cloud-upload" style="margin-left:1%;background: #3fc1c9;color:#fff;border:1px solid #3fc1c9;">学生导入</Button>
				</div>
			</div>
		</div>
		<div>
			<ss :tj="tj" ref="uaccountss" ></ss>
		</div>
		<add ref="add" @reload="load"></add>
		<importU ref="importU" v-on:reload="search()"></importU>
	</div>
</template>

<script>
	import ss from "./ss";
	import add from "./add";
	import importU from "./import";
	export default {
		name: "uaccountmanage",
		data() {
			return {
				tj: {
					name:'',//学生姓名
					dlzh:'',//登录账号
					wstate:'',//角色 
					nj:'',//年级
					bj:'',//班级
				},
				selections:[]//被选中的项
			}
		},
		methods: {
			search(){
				this.$refs.uaccountss.load();
			},
	        resettj(){
				this.tj.name='';
				this.tj.dlzh='';
				this.tj.wstate='';
				this.tj.nj='';
				this.tj.bj='';
	        },
			
			refresh(){
				this.$http.get("/host/readbook/uaccount/refreshUaccount.html")
				.then(datas => {
					if(datas.result){
						//删除成功 刷新页面
						this.$Message.info('刷新成功');
						this.$refs.tdtable.load();
					}else{
						//删除成功 刷新页面
						this.$Message.info(datas.msg);
						this.$refs.tdtable.load();
					}
				});
			},
			
			add(){
				this.$refs.add.openmodal();
			},
			
			load(){
				this.$refs.tdtable.load();
			},
			importU(){
				this.$refs.importU.modal0=true;
			}
		},
		components: { 
			ss,
			add,
			importU
		},
		mounted(){
		},
		watch:{
		},
		computed: {
		}
	}
</script>

<style>
</style>